function PLUGIN:Initialize()

end

function PLUGIN:addRot(ply , args)
	if CLIENT then return end
	
	local ent = ply:GetEyeTraceNoCursor().Entity
	local offset = Vector(tonumber( args[ 1 ] ),tonumber( args[ 2 ] ),tonumber( args[ 3 ] ))
	local freeze = args[4] or true

	for k , ent in pairs(ecs.Selections[ply]) do
		ent:SetAngles(ent:GetAngles() + offset)
		if freeze then
			ent:GetPhysicsObject():EnableMotion(false)
		end
	end
	if ecs.CanManipulate(ply, ent) then
		ent:SetAngles(ent:GetAngles() + offset)
		if freeze then
			ent:GetPhysicsObject():EnableMotion(false)
		end
	end
end
PLUGIN:AddServerCommand( "addrot" , PLUGIN.AddRot )


function PLUGIN:setAngle(ply , args)
	if CLIENT then return end
	
	local ent = ply:GetEyeTraceNoCursor().Entity
	local offset = Vector(tonumber( args[ 1 ] ),tonumber( args[ 2 ] ),tonumber( args[ 3 ] ))
	local freeze = args[4] or true

	for k , ent in pairs(ecs.Selections[ply]) do
		ent:SetAngles(offset)
		if freeze then
			ent:GetPhysicsObject():EnableMotion(false)
		end
	end
	if ecs.CanManipulate(ply, ent) then
		ent:SetAngles(offset)
		if freeze then
			ent:GetPhysicsObject():EnableMotion(false)
		end
	end
end
PLUGIN:AddServerCommand( "setang" , PLUGIN.setAngle )